<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="utf-8">
<title>滴答办公系统-班级修改</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="/media/layui/css/layui.css" media="all">

</head>
<body>

	<div class="layui-container" style="margin-top: 5px">
		<form class="layui-form" action="/classupdate" method="post">
		<div class="layui-form-item">
				<label class="layui-form-label">班级序号</label>
				<div class="layui-input-block">
					<input type="text" name="id" th:value="${class.id}" readonly="readonly" autocomplete="off"
						class="layui-input" id="f1">
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">班级名称</label>
				<div class="layui-input-block">
					<input type="text" name="class_Name" id="f2" th:value="${class.class_Name}" lay-verify="name" autocomplete="off"
						placeholder="请输入名称" class="layui-input">
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">班级学科</label>
				<div class="layui-input-block">
					<select name="major_Id" id="major_Id">
<!--        				<option value="-1">&#45;&#45;请选择学科&#45;&#45;</option>-->

      				</select>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">开班日期</label>
				<div class="layui-input-block">
				 <input type="text"  name="class_Date" th:value="${class.class_Date}" id="f4" autocomplete="off" class="layui-input">
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">班级周期</label>
				<div class="layui-input-block">
					<input type="text" name="class_Time" th:value="${class.class_Time}" id="f5" lay-verify="name" autocomplete="off"
						placeholder="请输入周期" class="layui-input">
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">班级地址</label>
				<div class="layui-input-block">
					<input type="text" name="class_Address" th:value="${class.class_Address}" id="f6" lay-verify="name" autocomplete="off"
						placeholder="请输入地址" class="layui-input">
				</div>
			</div>
			
		
			<div class="layui-form-item">
				<input class="layui-btn"  style="margin-left: 10%"  type="submit" value="确认修改">
			</div>
		</form>
	</div>
	<script type="text/javascript" src="/media/js/jquery.min.js"></script>
	<script src="/media/layui/layui.js"></script>
	<!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->
	<script>
		var form;
		$(function () {
			layui.use([ 'form', 'laydate' ],
					function() {
						form = layui.form, layer = layui.layer, laydate = layui.laydate;

					});
			findMajor()


		})

		function findMajor(){
			$.getJSON("/findMajor",function (result) {

				for (var i = 0;i< result.length;i++){
					$("#major_Id").append("<option value='"+result[i].id+"'>"+result[i].major_name+"</option>")
				}
				$("#major_Id").val([[${class.major_Id}]]);
				form.render("select");
			})

		}
	</script>
</body>
</html>